Rand & Randbetween

Imaging the need you may have when dealing with a large database to randomly sort the entries.  You can use the rand function to randomly sort a database.

Skill Builder:  Using the Rand Function to Randomize a Database

1.	Click 	In the Cell where you want your random number to be 
		generated.

2.	Type	The Function.  In this case the function is =rand(

3.  	Press	Enter.  When you press enter a random number will be 
		set for that particular row.  Repeat this process to give 
		each row a randomized number.

4.	Sort	The Database using the sort keys.  You will notice that 
		when you sort by the random numbers there is no 
		apparent pattern in your database, and  you have 
		successfully randomized your database.

The randbetween function is used as the rand function, with the exception that with the randbetween function, you can set outside parameters for your random numbers.  For instance, if you wanted to generate random salaries within a database, but wanted the salaries to fall between $20,000 and $90,000, you would do the following

Skill Builder:  Using the Randbetween Function to Randomize a 
	Database

1.	Click 	In the Cell where you want your random number to be 
		generated.

2.	Type	The Function.  In this case the function is 
		=randbetween(20000,90000)

		Notice that the only common used in this function is the 
		common between your parameters.

3.  	Press	Enter.  When you press Enter, a random number will be 
		set for that particular row.  Each number will fall within 
		the specified parameters.  Repeat this process to give 
		each row a randomized number.

Note:  The randbetween function will only work if the analysis toolpak has been installed.